#!/bin/awk -f
BEGIN{mode=0}
FNR==1{nodes2=$1;multi2=$2;loops2=$3} # case mode=2 (tilings.out)
FNR==3{nodes1=$1;multi1=$2} # case mode=1 (tiling.out)
FNR==3{nodes3=$1;multi3=$2; decofi=$1} # copa.out
FNR==4{nf4=NF} # this must be equal 2 for copas.out
FNR==3&&tolower($3)~/^[a-z]+$/{mode=3} # item 3 on line 3 is "deconame", only for copa type.
FNR==4&&NF==2{mode=4} # only copas type has two reals here
$0~/positional/{copa=1}
END{
  nl=FNR;
#  print nl,nodes1+3,mode;
#  print nl,nodes2*loops2+3,mode;
  if(nodes1+3==nl){mode=1}; # tiling.out
  if(nodes2*loops2+3==nl)mode=2; # tilings.out
  print mode;
}
